<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    new Promise((resolve, reject) => {
        //模拟网络请求
        setTimeout(() => {
            resolve('aaa')
        }, 1000)
    }).then(res => {
        console.log(res,'第一层的代码');
        //对结果进行第一次处理
        // return new Promise(resolve => {
        //     resolve(res + '111')
        // })
        // return Promise.resolve(res + '111')
        return res + '111'
    }).then(res => {
        console.log(res,'第二层代码');
        // return new Promise(resolve => {
        //     resolve(res + '222')
        // })
        // return Promise.resolve(res + '222')
        return res + '222'
    }).then(res => {
        console.log(res,'第三层代码');
    })
</script>
</body>
</html>